<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> 
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="-1">
<title>Browarex</title>
<script type="text/javascript">
<%@ include file="../js/jquery-1.8.3.min.js" %>
<%@ include file="../js/jquery.liquidcarousel.js" %>
<%@ include file="../js/paging.js" %>
<%@ include file="../js/jquery.poshytip.js" %>
<%@ include file="../js/jquery-ui-1.9.2.custom.min.js" %>
</script>
<style type="text/css">
<%@ include file="../stylesheets/tip-yellowsimple.css"%>
</style>
<script type="text/javascript">
$(document).ready(function() {
	$('#liquid').liquidcarousel({height:80, duration:100, hidearrows:false});
});
</script>
<script type="text/javascript">
	$(document).ready(function(){
		destroyTip();
		if($('#crmTip').css("display") != 'none')
			{	
				if(${link != null}) {
					window.setInterval(startBottleShake, 10000);
					window.setTimeout(showBottleFirstTime, 5*1000);
				}
			}
	});	
	
	function showBottleFirstTime(content)
	{
		createTip(content);
		$('#messageBottle').animate({top:'+=70'},1000,function(){				
			window.setTimeout(showTip, 1000);
		})	
	};
	
	function createTip(content)
	{
		var con = '<span class="innerSpan">Kliknij ${link} aby zobaczyć proponowane produkty !</span><br/>';
		
		if(content)
			{
				con = content;
			}
		$('#messageBottle').poshytip({
			className: 'tip-yellowsimple',
			showOn:'none',
			alignTo:'target',
			alignX:'right',
			alignY:'top',	
			content: con,
			offsetX: 5
		});	
	}
	
	function destroyTip()
	{
		$('#messageBottle').poshytip('destroy');
	}
	
	function showBottle()
	{		
		if($('#messageBottle').position().top == -55)
		{
			$('#messageBottle').addClass("Normal");
			$('#messageBottle').removeClass("WowGlow");	
			$('#messageBottle').animate({top:'+=70'},1000,function(){				
				window.setTimeout(showTip, 1000);
			})	
		}
	};
	
	function showTip()
	{
		$('#messageBottle').poshytip('show');	
	}	
	
	function updateTip(content)
	{
		$('#messageBottle').poshytip('update', content);	
	}	
	
	function hideTip()
	{
		$('#messageBottle').poshytip('hide');		
	}
	
	function hideBottle()
	{
		hideTip();
		$('#messageBottle').animate({top:'-=70'},1000);		
		window.setTimeout(function(){
			$('#messageBottle').addClass("WowGlow");
			$('#messageBottle').removeClass("Normal");		
		}, 900);
	}
	
	function startBottleShake()
	{
		if($('#messageBottle').position().top == -55)
		{
			$('#messageBottle').effect('shake', {times:3},300);
		}
	}
</script>